package com.yaoxiaowen.project2;

import android.app.Application;

import com.tc.tickets.push.Push;
import com.yaoxiaowen.project2.util.log.debug.DebugState;

import org.xutils.x;

import io.realm.Realm;
import io.realm.RealmConfiguration;


/**
 * Created by Yw on 2015/12/23 0023.
 * QQ:2669932513
 */
public class MainApplication extends Application {

    private static MainApplication app;

    public static MainApplication getInstance(){
        return app;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;

        Realm.init(this);
        RealmConfiguration realmConfiguration = new RealmConfiguration.Builder().name("realmDb").build();
        Realm.setDefaultConfiguration(realmConfiguration);

        //xutils3
        x.Ext.init(this);
        x.Ext.setDebug(DebugState.DEBUG);

//        Push.setDebugMode(true);
//        Push.init(this);
//        Push.initCrashHandler(this);

//        Push.stateDebugMode(true);
        Push.setDebugMode(true);
        Push.init(this);


    }
}
